package com.hxkj.service;

import com.alicp.jetcache.anno.CacheInvalidate;
import com.alicp.jetcache.anno.CacheType;
import com.alicp.jetcache.anno.CacheUpdate;
import com.alicp.jetcache.anno.Cached;
import com.hxkj.domain.po.AuthFunction;
import com.hxkj.domain.po.FunctionTree;
import com.platform.common.domain.annotation.EnableDataSource;
import com.platform.common.domain.result.ResultDataStruct;
import com.platform.common.domain.result.ResultMessageStruct;
import com.platform.common.domain.result.ResultPageStruct;
import com.platform.common.domain.to.PageTo;

import java.util.List;
import java.util.Map;

/**
 * @author Mrmas
 * @create 2018-05-21 17:17
 * @desc 功能列表接口
 **/
public interface FunctionService {

    /**
     * 从缓存中获取数据
     * @param
     * @return
     * @throws Exception
     */
    @Cached(name="functionCache", expire = 60,cacheType = CacheType.REMOTE)
    ResultPageStruct getFunctionList(AuthFunction authFunction, PageTo pageParam)throws Exception;

    /**
     * 存功能数据
     * @param authFunction
     * @return
     */
    @CacheInvalidate(name="functionCache")
    ResultMessageStruct saveAuthFunction(AuthFunction authFunction) throws Exception;

    /**
     * 更新功能数据
     * @param authFunction
     * @return
     */
    @CacheInvalidate(name="functionCache")
    ResultMessageStruct updateAuthFunction(AuthFunction authFunction)throws Exception;

    /**
     * 获取功能单个数据
     * @param authFunction
     * @return
     */
    ResultDataStruct queryAuthFunction(AuthFunction authFunction)throws Exception;

    /**
     * 删除功能列表
     * @param authFunction
     * @return
     */
    @CacheInvalidate(name="functionCache")
    ResultMessageStruct deleteAuthFunction(AuthFunction authFunction)throws Exception ;


    /**
     * 更新排序
     *
     * @param ids 功能信息
     * @throws Exception
     */
    @CacheInvalidate(name="functionCache")
    ResultMessageStruct modifyOrderId(Map<String,Object> map)throws Exception ;
}
